package com.zzs.server.dao.redis;

import com.zzs.common.core.constant.RedisKeyConsts;
import com.zzs.common.core.entity.redis.TestCaseCache;
import com.zzs.common.redis.service.RedisService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

/**
 * @author zzs
 * @date 2025/03/25
 */
@Repository
public class TestCaseCacheManager {
    @Autowired
    private RedisService redisService;

    public void save(TestCaseCache cache) {
        String key = RedisKeyConsts.getTestCaseKey(cache.getProblemId());
        redisService.saveValue(key, cache);
    }

    public void remove(long problemId) {
        String key = RedisKeyConsts.getTestCaseKey(problemId);
        redisService.removeKey(key);
    }
}
